package com.zhiwang.xiaoqu.mvp.presenter

import androidSchedule
import com.zhiwang.xiaoqu.di.annotation.ActivityScope
import com.zhiwang.xiaoqu.mvp.model.RestApi
import com.zhiwang.xiaoqu.mvp.model.response.UpdateCheck
import responseFunc
import javax.inject.Inject

@ActivityScope
class UpdatePresenter @Inject constructor(var restApi: RestApi) {


    fun checkUpdate(onSuccess: (UpdateCheck) -> Unit) {

        with(restApi) {
            checkUpdate()
                .androidSchedule()
                .responseFunc()
                .subscribe({
                    onSuccess(it)
                }, {
                }, {

                })
        }
    }

}